///////////////////////////////////////////////////////////////////////
//                                                                   // 
//    Copyright© 2014 Elo Touch Solutions. All rights reserved.      //
//                                                                   //
//    This computer program source code is provided "as is"          //
//    without warranty of fitness or suitability for any purpose.    //
//    Elo Touch Solutions is not responsible for consequential or    //
//    incidental damages resulting from or related to the use of     //
//    this code. This code may be used in part or in its entirety    //
//    only to support the use of Elo Touch Solutions products.       //
//                                                                   //
///////////////////////////////////////////////////////////////////////

// EloInterface.h
//
// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the ELOMTAPI_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// ELOMT_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.

#pragma once

// -----------------------------------------------------------------------------
// Interface function calls 
// -----------------------------------------------------------------------------

#ifdef ELOMTAPI_EXPORTS
#define ELOMT_API __declspec(dllexport)
#else
#define ELOMT_API __declspec(dllimport)
#endif

#ifdef __cplusplus
extern "C" {
#endif 

// Get total number of touch screens for current system
ELOMT_API int EloGetScreenCount() ;

// Enable or disable touch of specified screen by screen index
ELOMT_API bool EloEnableTouch (int nScreenIndex, BOOL bEnableTouch);

// Get touch state of specified by screen index
ELOMT_API bool EloIsTouchEnabled (int nScreenIndex);

// Get touch point from touch screen. *touch_status return touch status
// as defined in mmioctl.h (TOUCH_STATUS)
ELOMT_API int EloGetTouchPacket (int nScreenIndex, int* x, int* y, int* z, TOUCH_STATUS* touch_status, bool bRaw);

// Get calibration data for a touch screen
ELOMT_API bool EloGetCalData (int nScreenIndex, ELO_CAL_DATA * pCalData);

// Set calibration data for a touch screen
ELOMT_API bool EloSetCalData (int nScreenIndex, ELO_CAL_DATA * pCalData);

// Get diagnostics data for a specified touch screen
ELOMT_API DWORD EloGetDiagnosticsData(int nScreenIndex, ELO_DIAGNOSTICS * pDiag);

// Get U Alignment counts (for IntelliTouch Plus, PID0xnn22 only)
ELOMT_API int EloGetUAlignCounts (int nScreenIndex, int* u1_cycles, int* u2_cycles);

// Get the rectangle of current clipping area
ELOMT_API int EloGetClipRectangles(int nScreenIndex, ELO_CLIPPING_MODE* pClipMode);

// Set clipping rectangle bounds
ELOMT_API int EloSetClipRectangles(int nScreenIndex, ELO_CLIPPING_MODE* pClipMode);

// Get Full screen clipping rectangles
ELOMT_API int EloGetFullScreenClipRectangle(int nScreenIndex, ELO_FULL_SCREEN_CLIPPING* pFullScreenClipMode);

// Set Full screen clipping rectangles
ELOMT_API int EloSetFullScreenClipRectangle(int nScreenIndex, ELO_FULL_SCREEN_CLIPPING* pFullScreenClipMode);

// Get Edge Acceleration data for a touch screen
ELOMT_API int EloGetEdgeAcceleration(int nScreenIndex, int w_now, int h_now, ELO_ACCEL_DATA* pAccel);

// Set Edge Acceleration for a touch screen
ELOMT_API int EloSetEdgeAcceleration(int nScreenIndex, int w_now, int h_now, const ELO_ACCEL_DATA* pAccel);

// Set debug level by a specified screen by screen index
ELOMT_API bool EloSetDebugLevel (int nScreenIndex, ULONG ulDbgLevels);

// Get debug level by a specified screen by screen index
ELOMT_API DWORD EloGetDebugLevel (int nScreenIndex);

// Enable touch sound
ELOMT_API bool EloEnableBeep (int bEnable);

// Get state of beep
ELOMT_API int EloIsBeepEnabled ();

// Get MONITOR strucu by windows monitor number
ELOMT_API MONITOR * EloGetMonitorByWinMonNum (int nWinMonNum);

// Get MONITOR struct by a monitor index 
ELOMT_API MONITOR * EloGetMonitorByIndex (int nMonitorIndex);

// Go to monitor given by the Windows handle and a monitor index
ELOMT_API void EloGotoMonitor (HWND hWnd, int nMonitorIndex);

// Get SCREEN struct by a specified screen by screen index
ELOMT_API SCREEN* EloGetScreenByIndex (int nScreenIndex);

// Get monitor index by windows monitor number
ELOMT_API int EloGetMonitorIndexByWinMonNum (int nWinMonNum);

// Get Monitor count
ELOMT_API int EloGetMonitorCount ();

// Get PulseTouch TrackerParams of a touch screen. Please make sure the size of the 
// array of integers should be at least MAX_TRACKER_PARAMS
ELOMT_API int EloGetAprParameters (int nScreenIndex, int * pnParameters, int nParameterCount);

// Set Pulse Touch TrackerParams by given # of Parameter and a specified screen by screen index
ELOMT_API bool EloSetAprParameters (int nScreenIndex, int * pnParameters, int nParameterCount);

// Get progress info for downloading PulseTouch calibration data
ELOMT_API int EloGetAprFlashProgress (int nScreenIndex, int * cur_page);

// Get Serial number of PulseTouch 700X
ELOMT_API bool EloGetApr700XSerialNumbers (int nScreenIndex, ELO_GET_SERIAL_NUMBERS *pSN);

// Flush the controller buffer by a specified screen by a screen index
ELOMT_API bool EloFlushControllerSmartsetBuffer (int nScreenIndex);

// Get controller firmware version
ELOMT_API bool EloGetControllerFWVersion (int nScreenIndex, char* ver, size_t nLen);

// Send Smartset command
ELOMT_API int EloSendSmartsetCommand( PSMARTSETDATA pSmartsetData );

// Get Smartset response
ELOMT_API int EloGetSmartsetResponse( PSMARTSETDATA pSmartsetData );

// Get Smartset response status 
ELOMT_API int EloGetSmartsetResponseStatus( PSMARTSETDATA pSmartsetData );

// Apply transactional Smartset command to retrieve the response data
ELOMT_API BOOL EloSmartsetTransaction(SMARTSETDATA* pSS, SMARTSET_PKT* pSSPACKET=NULL, int nNumPkts=0, int* pnRespPkts=NULL, int nDelay=20);

// Clear all pending GetPoint ioctls
ELOMT_API bool EloClearAllGetPoint ();

// Get IR internal sound setting by a specified screen of screen index
ELOMT_API bool EloGetIRInternalSound( int nScreenIndex, UCHAR &State, DWORD &Freq, DWORD &Dura );

// Set IR internal sound setting by a specified screen of screeen index
ELOMT_API bool EloSetIRInternalSound( int nScreenIndex, UCHAR State, DWORD Freq, DWORD Dura );

// Copy device parameters of a touch screen to Elo global registry keys
ELOMT_API bool EloCopyDeviceParametersToGlobalKey (int nScreenIndex);

// Copy Elo global registry keys to device parameters of a touch screen
ELOMT_API bool EloCopyGlobalKeyToDeviceParameters (int nScreenIndex);

// Apply Elo global registry keys to a touch screen
ELOMT_API bool EloApplyGlobalKeys( int nScreenIndex );

// Store device keys to Elo global registry keys
ELOMT_API bool EloStoreDevKeysToGlobal( int nScreenIndex );

// Beep at the specified frequency and duration
ELOMT_API bool EloMakeBeep(unsigned int frequency, unsigned int duration);

// Get multiple touche points from a touch screen
ELOMT_API bool EloGetMultiTouch (int nScreenIndex, MT_TOUCH* pMtTouch);

// Get Max Touch point of given screen index
ELOMT_API bool EloGetMaxTouch (int nScreenIndex, ULONG &nTouch );

// Set Max Touch point of given screen index
ELOMT_API bool EloSetMaxTouch (int nScreenIndex, ULONG nTouch );

// Get Mouse Mode of given screen index
ELOMT_API bool EloGetForceMouse (int nScreenIndex, ULONG &lMouse );

// Set Mouse Mode of given screen index
ELOMT_API bool EloSetForceMouse (int nScreenIndex, ULONG lMouse );

// Get mouse mode
ELOMT_API int EloGetMouseMode (int nScreenIndex);

// Set mouse mode
ELOMT_API bool EloSetMouseMode (int nScreenIndex, int nMouseMode);

// Locking mechanism to protect share object in Smartset command
// EloAcquireSmartsetLock and EloReleaseSmartsetLock are used if you want to control
// Smartset transaction EloSendSmartsetCommand and EloGetSmartsetResponse. We strongly
// recommend to use EloSmartsetTransaction since it is thread safe. Acquire Smartset 
// lock prevent from other Smartset command to enter controller
ELOMT_API bool EloAcquireSmartsetLock( int nScreenIndex, int nRetry = 1 );

// Release Smartset lock
ELOMT_API bool EloReleaseSmartsetLock( int nScreenIndex );

ELOMT_API bool EloGetTouchSensitivity (int nScreenIndex, ELO_TOUCH_SENSITIVITY* pnTouchSensitivity);
ELOMT_API bool EloSetTouchSensitivity (int nScreenIndex, ELO_TOUCH_SENSITIVITY nTouchSensitivity);

#ifdef __cplusplus
}
#endif


